﻿// <copyright file="SqlGenerator.cs" company="DotNetSide">
// Copyright (c) 2010 All Right Reserved
// </copyright>
// <author>Leo.Alario</author>
// <date>13/10/2010 18.11.00</date>

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.IO;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.TextEditor.Document;

namespace DotNetSide.SqlEditor
{
    public partial class SqlEditorCtrl : UserControl
    {
        public SqlEditorCtrl()
        {
            InitializeComponent();
        }

        private void textEditorControl_Load(object sender, EventArgs e)
        {
            // http://wiki.sharpdevelop.net/Syntax%20highlighting.ashx
            string dir = Path.GetDirectoryName(GetType().Assembly.Location);
            FileSyntaxModeProvider fsmProvider = new FileSyntaxModeProvider(dir);
            HighlightingManager.Manager.AddSyntaxModeFileProvider(fsmProvider);
            textEditorControl.SetHighlighting("SQL");
        }
        public override string Text
        {
            get
            {
                return textEditorControl.Text;
            }
            set
            {
                textEditorControl.Text = value;
            }
        }
    }
}
